package com.ooula.customcalendarview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import com.ooula.customcalendarview.view.NewCalendar;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class MainActivity extends AppCompatActivity implements NewCalendar.NewCalendarListener,NewCalendar.NewCalendarOnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        NewCalendar newCalendar=(NewCalendar)findViewById(R.id.newCalendar);
        newCalendar.listener=this;
        newCalendar.calendarOnClickListener=this;
    }

    @Override
    public void onItemLongPress(Date data) {
        DateFormat df= SimpleDateFormat.getDateInstance();
        Toast.makeText(this,df.format(data),Toast.LENGTH_LONG).show();
    }

    @Override
    public void onItemOnClickListener(Date date) {
        Toast.makeText(this,date.getDay()+"",Toast.LENGTH_LONG).show();

    }
}
